package com.thrsdk;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.view.KeyEvent;

import com.thrsdk.listener.IExitListener;
import com.thrsdk.listener.IListener;
import com.thrsdk.listener.InitListener;
import com.thrsdk.listener.SDKListenerInfo;
import com.thrsdk.listener.UserListenerInfo;
import com.thrsdk.model.data.PayInfo;
import com.thrsdk.model.data.RoleInfo;
import com.thrsdk.model.protocol.bean.CustomerBean;
import com.thrsdk.model.protocol.bean.LoginMessage;
import com.thrsdk.model.protocol.bean.ResCertificate;
import com.thrsdk.model.protocol.bean.ShareBean;

/**
 * Created on 2021/7/29.
 */
public abstract class DYFusionSDK {
    private static DYFusionSDK sInstance;

    public static DYFusionSDK getInstance() {
        if (sInstance == null) {
            synchronized (DYFusionSDK.class) {
                if (sInstance == null) sInstance = new THFSDKClient();
            }
        }
        return sInstance;
    }

    public abstract void applicationInit(Context context);

    public abstract void initInterface(Activity activity, String appid, String appkey, InitListener listener);

    public abstract void login(Activity context, IListener<LoginMessage> listener);

    public abstract void payment(Activity activity, PayInfo payInfo, SDKListenerInfo listener);

    public abstract void exit(Activity activity, IExitListener exitlistener);

    public abstract void switchAccount();

    public abstract void getCertificateData(Context context, IListener<ResCertificate> listener);

    public abstract void setUserListener(UserListenerInfo listener);

    public abstract void setExtData(Context context, RoleInfo roleData);

    public abstract void openLog(Context context, boolean isopen);

    public abstract void onStart(Activity activity);

    public abstract void onCreate(Activity activity);

    public abstract void onStop(Activity activity);

    public abstract void onDestroy(Activity activity);

    public abstract void onResume(Activity activity);

    public abstract void onPause(Activity activity);

    public abstract void onRestart(Activity activity);

    public abstract void onNewIntent(Intent intent);

    public abstract void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data);

    public abstract void onKeyDown(int keyCode, KeyEvent event);

    public abstract void onConfigurationChanged(Configuration newConfig);

    public abstract void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults);

    public abstract Context getContext();

    //2022.02.18 增加渠道号获取
    public abstract String getChannelNumber(Activity activity);

    //2022.02.18 增加临时获取用户中心
    public abstract void onMainUserCenter(Activity activity);

    //2022.07.04 增加平台标识
    public String getPlatformNumber(Activity activity) {
        return null;
    }

    // TODO: 2023-04-23 增加分享
    public void onShare(Activity activity, ShareBean shareBean, IListener<String> shareListener) {
    }

    // TODO: 2023-04-23 增加客服
    public void onCustomerService(Activity activity, CustomerBean customerBean) {
    }

    // TODO: 2023-04-26 增加渠道第三方登陆
    public void onThirdCenter(Activity activity, IListener<LoginMessage> thirdlistener) {
    }

    // TODO: 2023-05-11 增加获取货币单位 
    public void onGetPriceCurrencySuccess(Activity activity, String procuctid, IListener<String> IPriceCurrencySuccess) {
    }

    // TODO: 2023-07-03 增加埋点事件上报
    public void onEventReport(Activity activity, String eventName, String jsonevent) {
    }
}
